<?php
	class XmlClass {
		var $xml;

		function XmlClass(){
			$this->xml='<?xml version="1.0" encoding="utf-8"?><xml>';
		}
		
		function make($array=0){					
			if($array==0 || count($array)<1) return;						
			foreach($array as $key=>$value){							
				if(is_int($key)) $key='el';									
				$this->xml.='<'.$key.'>';							
				if(is_array($value)) $this->make($value);
				else {
					if(preg_match('/[<>&]+/i', $value)) $this->xml.='<![CDATA['.trim($value).']]>';		
					else $this->xml.=trim($value);	
				}		
				$this->xml.='</'.$key.'>';
			}					
		}

		function get(){
			return $this->xml."</xml>";
		}		
	}
?>
